//导入http模块
const http = require('http');
//创建服务对象
const server = http.createServer((request, response) => {

    //获取请求体
    let body = ''
    request.on('data', (arguments) => { //绑定data事件
        body += arguments
    });
    request.on('end', (arguments) => { //绑定end事件
        console.log('请求体\n' + body);
        //设置响应体
        response.end('Http!');
    });

});
//设置服务监听，启动服务
server.listen(9000, () => {
    console.log('The service has already been opened!!!');
});